<template>
  <div :class="'mui-row menuNav '+ (is_iphoneX?'iphonex':'')">
    <ul class="mui-table-view">
      <li>
        <div :class="'navcontent '+(active == 'index'?'active':'')">
          <router-link to="/index">
            <i class="bottom-tab-icon icon index-icon"></i>
            <span>主页</span>
          </router-link>
        </div>
      </li>
      <li >
        <div :class="'navcontent '+(active == 'course'?'active':'')">
          <router-link to="/course">
            <i class="bottom-tab-icon icon course-icon"></i>
            <span>课程</span>
          </router-link>
        </div>
      </li>
      <li v-if="menu_open_status.ifopen_quesiton == 1">
        <div :class="'navcontent '+(active == 'question'?'active':'')">
          <router-link to="/question">
            <i class="bottom-tab-icon icon quiz-icon"></i>
            <span>题库</span>
          </router-link>
        </div>
      </li>
      <li v-if="menu_open_status.ifopen_ask == 1">
        <div :class="'navcontent '+(active == 'ask'?'active':'')">
          <router-link to="/ask">
            <i class="bottom-tab-icon icon discuss-icon"></i>
            <span>问答</span>
           </router-link>
        </div>
      </li>
      <li>
        <div :class="'navcontent '+(active == 'member'?'active':'')">
          <router-link to="/member">
            <i class="bottom-tab-icon icon info-icon"></i>
            <span>我的</span>
          </router-link>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
import { mapState } from 'vuex';
export default {
  props:{
    active:{
      type : String,
      value : 'index'
    }
  },
  mounted(){
    
  },
  computed:{
    ...mapState(['menu_open_status','is_iphoneX'])
  }
};
</script>
<style scoped lang="scss">
/* 底部菜单 */
/*主菜单*/
.menuNav {
  display: inline-block;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0.5rem;
  z-index: 1002;
  background: #fff;
  box-shadow: 0 -0.01rem rgba(0, 0, 0, 0.1);
}

.menuNav.iphonex {
  height: 0.8rem;
  padding-bottom: 0.3rem;
}

.menuNav ul {
  display: flex;
  height: 100%;
}

.menuNav ul li {
  flex: 1 1 20%;
  height: 0.5rem;
}

.menuNav ul li .navcontent {
  width: 100%;
  height: 100%;
  text-align: center;
}

.menuNav ul li .navcontent a {
  float: left;
  width: 100%;
  height: 100%;
  padding-top: 0.05rem;
  display: flex;
  justify-content: space-around;
  flex-direction: column;
}

.menuNav ul li .navcontent a .bottom-tab-icon {
  height: 0.24rem;
  width: 0.24rem;
  display: block;
  margin: 0 auto;
}

.menuNav ul li .navcontent a .index-icon {
  background: url("../../assets/images/menu-nav-home-icon.png") no-repeat center/cover;
}

.menuNav ul li .navcontent.active a .index-icon {
  background: url("../../assets/images/menu-nav-home-icon-2.png") no-repeat center/cover;
}

.menuNav ul li .navcontent a .course-icon {
  background: url("../../assets/images/menu-nav-course-icon.png") no-repeat center/cover;
}

.menuNav ul li .navcontent.active a .course-icon {
  background: url("../../assets/images/menu-nav-course-icon-2.png") no-repeat center/cover;
}

.menuNav ul li .navcontent a .quiz-icon {
  background: url("../../assets/images/menu-nav-question-icon.png") no-repeat center/cover;
}

.menuNav ul li .navcontent.active a .quiz-icon {
   background: url("../../assets/images/menu-nav-question-icon-2.png") no-repeat center/cover;
}

.menuNav ul li .navcontent a .discuss-icon {
  background: url("../../assets/images/menu-nav-ask-icon.png") no-repeat center/cover;
 
}

.menuNav ul li .navcontent.active a .discuss-icon {
  background: url("../../assets/images/menu-nav-ask-icon-2.png") no-repeat center/cover;

}

.menuNav ul li .navcontent a .info-icon {
  background: url("../../assets/images/menu-nav-user-icon.png") no-repeat center/cover;

}

.menuNav ul li .navcontent.active a .info-icon {
  background: url("../../assets/images/menu-nav-user-icon-2.png") no-repeat center/cover;
}

.menuNav ul li .navcontent a span {
  float: left;
  width: 100%;
  text-align: center;
  color: rgba(41, 43, 51, 0.4);
  font-size: 0.12rem;
  line-height: 0.14rem;
}

.menuNav ul li .navcontent.active a span {
  color: #0486fe;
}
</style>


